package communication;

import java.io.IOException;

import lejos.nxt.comm.NXTCommConnector;
import lejos.nxt.comm.NXTConnection;
import lejos.nxt.comm.RS485;
import lejos.nxt.comm.RS485Connection;
import lejos.nxt.remote.RemoteMotor;
import lejos.nxt.remote.RemoteNXT;

@SuppressWarnings("unused")
public class NXTLCPRequest {
	
	 public static void main(String[] args) throws Exception{
	
		/*NXTCommConnector c = RS485.getConnector();		
		RemoteNXT nxt = new RemoteNXT("GRP061",c);
		RemoteMotor[] motors = {nxt.A, nxt.B, nxt.C};		
		motors[0].forward();*/
		 
		 //SERVIDOR
		 NXTConnection conn = RS485.getConnector().connect("GRP061", NXTConnection.PACKET); 
		 if (conn==null) {
		     throw new IOException("Failed to connect to other brick via RS485");
		 }
		 
		 /* CLIENTE
		 conn=RS485.getConnector().waitForConnection(0,NXTConnection.PACKET);
		*/
	 }

}
